home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / SNNSV32.ZIP / SNNSv3.2 / tools / sources / snnsbat.h < prev   
Encoding:
C/C++ Source or Header  |  1994-04-25  |  4.3 KB  |  141 lines

  1. /*****************************************************************************
  2.   FILE           : snnsbat.h
  3.   SNNS VERSION   : 3.2
  4.  
  5.   PURPOSE        : snnsbat function prototypes 
  6.   NOTES          :
  7.  
  8.   AUTHOR         : Guenter Mamier
  9.   DATE           : 16.03.1993
  10.  
  11.   CHANGED BY     : 
  12.   IDENTIFICATION : @(#)snnsbat.h    1.7 4/20/94
  13.   SCCS VERSION   : 1.7 
  14.   LAST CHANGE    : 4/20/94
  15.  
  16.              Copyright (c) 1990-1994  SNNS Group, IPVR, Univ. Stuttgart, FRG
  17.  
  18. ******************************************************************************/
  19. #ifndef _SNNSBAT_DEFINED_
  20. #define  _SNNSBAT_DEFINED_
  21.  
  22. /* begin global definition section */
  23.  
  24. /* end global definition section */
  25.  
  26. /* begin private definition section */
  27.  
  28. /*****************/
  29. /*    defines    */
  30. /*****************/
  31.  
  32. #define SAVE_PERIOD 1800          /* save temp file every 1800 sec.    */
  33. #define NO_OF_CYCLES_DISPLAYED  100     /*  display not more than 100 cycles */
  34.  
  35. #ifndef PATH_MAX                    /*  longest path name               */
  36. #define PATH_MAX 512
  37. #endif
  38.  
  39. #define ABNORMAL  TRUE
  40. #define NORMAL      FALSE
  41.  
  42. #define IsKey(x,y) (strcmp(x,y) == 0)
  43.  
  44. /*****************/
  45. /*    globals    */
  46. /*****************/
  47.  
  48.  
  49. static FILE     *file_out = NULL,
  50.                 *file_in = NULL;
  51. static char     *tmp_file1, *tmp_file2, *netname,
  52.              log_file[PATH_MAX+1];
  53. static long        starttime, HZ_value;
  54. static struct tms  tp;
  55. static int      no_of_sites, no_of_links, no_of_units, cycle,
  56.                 no_of_patterns, no_of_return_values, tmp_switch,
  57.             no_of_cycles, 
  58.                 no_of_learn_param, no_of_init_param,
  59.                 no_of_var_dim[2],
  60.                 start_pattern, end_pattern,
  61.             shuffle, shuffleSubPat,
  62.                 input_included, output_included,
  63.                 SubPatternISize_param[5],
  64.                 SubPatternOSize_param[5],
  65.                 SubPatternIStep_param[5],
  66.                 SubPatternOStep_param[5],
  67.                 exec_loop = 0;
  68. static float     *return_values,
  69.             learn_param[NO_OF_LEARN_PARAMS],
  70.                 init_param[NO_OF_INIT_PARAMS],
  71.                 best_net_error;
  72. static char     config_file[PATH_MAX+1],
  73.                 net_file[PATH_MAX+1],
  74.                 trained_net_file[PATH_MAX+1],
  75.                 learn_pat_file[PATH_MAX+1],
  76.                 test_pat_file[PATH_MAX+1],
  77.                 res_file[PATH_MAX+1],
  78.                 init_func[80],
  79.                 init_param_string[PATH_MAX+1],
  80.                 learn_param_string[PATH_MAX+1],
  81.                 SubPatternISize_string[PATH_MAX+1],
  82.                 SubPatternOSize_string[PATH_MAX+1],
  83.                 SubPatternIStep_string[PATH_MAX+1],
  84.                 SubPatternOStep_string[PATH_MAX+1];
  85. static time_t      lasttime;
  86. static int      InitParamFlag = 0,
  87.                 LearnParamFlag = 0,
  88.                 NoOfInitParamFlag = 0,
  89.                 NoOfLearnParamFlag = 0,
  90.                 NoOfVarDimFlag = 0,
  91.                 SubPatternISizeFlag =0,
  92.                 SubPatternOSizeFlag =0,
  93.                 SubPatternIStepFlag =0,
  94.                 SubPatternOStepFlag =0,
  95.                 NetworkFileFlag = 0,
  96.                 TrainedNetworkFileFlag = 0,
  97.                 LearnPatternFileFlag = 0,
  98.                 TestPatternFileFlag = 0,
  99.                 ResultFileFlag = 0,
  100.                 InitFunctionFlag = 0,
  101.                 MaxLearnCyclesFlag = 0,
  102.             MaxErrorToStopFlag = 0,
  103.                 ResultMinMaxPatternFlag = 0,
  104.                 ShuffleFlag = 0,
  105.                 ShuffleSubPatFlag = 0,
  106.                 ResultIncludeInputFlag = 0,
  107.                 ResultIncludeOutputFlag = 0,
  108.                 PatternWarning = 0,
  109.                 SyntaxError = 0,
  110.                 SyntaxWarning = 0;
  111.            
  112.  
  113. /*****************/
  114. /*  prototypes   */
  115. /*****************/
  116.  
  117. static bool  skipComments(register FILE *stream);
  118. static void  skipRestOfLine(register FILE  *stream);
  119. static void  errChk(int errNo);
  120. static void  writeLearnFuncValues(void);
  121. static void  writeInfo(FILE *stream);
  122. static void  writeStatistics(bool status);
  123. static void  writeCaughtMsg(int);
  124. static void  emergency_exit(int);
  125. static void  exit_batchlearn(int);
  126. static void  catchSignals(void);
  127. static int   IsOld(char *stream);
  128. static int   getYesNoSwitch(FILE  *file_in);
  129. static void  do_initial_log(void);
  130. static void configError(int err_code, char* err_string);
  131. static bool scanParameter(void *field, char  *string, int number, bool isInt);
  132. static int parseFile(int op_code);
  133. static void trainNet(void);
  134. static void computeResultfile(void);
  135.  
  136. /* end private definition section */
  137.  
  138. #endif 
  139.  
  140.  
  141.